# scans all values in a group for gaps
# and writes the results to vadb
GAPGroupExamination <- function(groupcode, verbose=TRUE) {
  if (verbose==TRUE) cat("retrieving symbols of group", groupcode, "from vadb\n")
  getSymbolsGroup(groupcode, daysbefore=350, daysafter=30)
  groupinfo <- getDBGroup(groupcode)
  dimgroupinfo <- dim(groupinfo)
  con <- connectToVadb()
  
  for (i in 1:dimgroupinfo[1]) {
    if (verbose==TRUE) cat("extracting Gaps of", groupinfo[i,"code"])
    GAPEX <- GAPExamination(get(paste(groupinfo[i,"code"], ".vadb", sep="")), onlyGaps=TRUE)
    # slash gaps before from date
    subsetstring <- paste(groupinfo[i,"from"], "/", sep="")
    GAPEX <- GAPEX[subsetstring]
    if (verbose==TRUE) cat(" write to db... ")    
    fillGapsIntoVadb(con, groupinfo[i,"code"], groupcode, GAPEX)
    if (verbose==TRUE) cat(" done\n")    
  }
}